package cn.b.sky.shop.activiti;

import org.restlet.data.MediaType;
import org.restlet.representation.InputRepresentation;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

import java.io.InputStream;

public class MyStencilsetRestResource extends ServerResource {
  @Get
  public InputRepresentation getStencilset() {
    String language = (String) getRequest().getAttributes().get("language");
    InputStream stencilsetStream = this.getClass().getClassLoader()
        .getResourceAsStream("stencilset_" + language + ".json");
    InputRepresentation stencilsetResultRepresentation = new InputRepresentation(stencilsetStream);
    stencilsetResultRepresentation.setMediaType(MediaType.APPLICATION_JSON);
    return stencilsetResultRepresentation;
  }
}
